<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <script src="https://unpkg.com/react@17/umd/react.development.js"></script>
  <script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
  <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>

  <body>
    <div id="root"></div>
    <script type="text/babel">
      function App() {
        let flag = false
        let login = '登录'
        let logout = '退出'
        return flag ? login : logout
      }
      ReactDOM.render(<App />, document.getElementById('root'))
    </script>
    <div id="root1"></div>
    <script>
      function App1() {
        let flag = true
        let login = '登录'
        let logout = '退出'
        return ReactDOM.render(
          flag ? login : logout,
          document.getElementById('root1')
        )
      }
      App1()
    </script>
  </body>
</html>
